import request from '../../../../../public/js/common/api/api.js';

const AuxBizUrl = Utils.CurDomain.AuxBizUrl;
const SysPlfUrl = Utils.CurDomain.SysPlfUrl;
const MasterDataUrl = Utils.CurDomain.MasterDataUrl;
const SubDataUrl = Utils.CurDomain.SubDataUrl;
const PartnerSvcUrl = Utils.CurDomain.PartnerSvcUrl;


const _ajaxOptions = {
    contentType: 'application/json',
    dataType: 'text',
    async: true,
    dataFilter(data, type) {
        return data;
    }
};
export default class certRegsApi {
    /**
     * 查询 动物合格证登记列表
     * @param data
     * @returns 
     */
    static postAnmlQtCertRegsList(data) {
        return request.post(`${AuxBizUrl}/anmlqtcertregs/plist`, data);
    }

    /**
     * 创建 动物合格证登记
     * @param data
     * @returns 
     */
    static postAnmlQtCertRegs(data) {
        return request.post(`${AuxBizUrl}/anmlqtcertregs`, data, true, _ajaxOptions);
    }

    /**
     * 更新 动物合格证登记
     * @param data
     * @returns 
     */
    static putAnmlQtCertRegs(id, data) {
        return request.put(`${AuxBizUrl}/anmlqtcertregs/${id}`, data, true, _ajaxOptions);
    }

    /**
     * 查询 动物合格证登记 详情
     * @param data
     * @returns
     */
    static getAnmlQtCertRegs(id) {
        return request.get(`${AuxBizUrl}/anmlqtcertregs/${id}`);
    }

    /**
     * 删除 动物合格证登记
     * @param data
     * @returns 
     */
    static deleteAnmlQtCertRegs(id) {
        return request.delete(`${AuxBizUrl}/anmlqtcertregs/${id}`);
    }

    /**
     * 提交 动物合格证登记
     * @param ids
     * @returns 
     */
    static submitReceiveTables(ids) {
        return request.post(`${AuxBizUrl}/anmlqtcertregs/submit`, ids);
    }
    /**
     * 反提交 动物合格证登记
     * @param ids
     * @returns 
     */
    static rollSubmitReceiveTables(ids) {
        return request.post(`${AuxBizUrl}/anmlqtcertregs/resubmit`, ids);
    }
    /**
     * 审核 动物合格证登记
     * @param ids
     * @returns 
     */
    static auditReceiveTables(ids) {
        return request.post(`${AuxBizUrl}/anmlqtcertregs/audit`, ids);
    }
    /**
     * 反审核 动物合格证登记
     * @param ids
     * @returns 
     */
    static rollReceiveTables(ids) {
        return request.post(`${AuxBizUrl}/anmlqtcertregs/reaudit`, ids);
    }

    /**
     * 获取公司
     * @param data
     * @returns 
     */
    static queryBaseOrgunitList(upoid, aotype) {
        return request.get(`${SysPlfUrl}/yyorgunits/by/q?upoid=${upoid}&aotype=${aotype}`);
    }
    /**
    * 获取代宰户
    * @param data
    * @returns 
    */
    static getsltrSupp(data) {
        const searchInfoParam = Utils.IsNotNull(data.searchInfo) ? `&SearchInfo=${data.searchInfo}` : '';
        return request.get(`${PartnerSvcUrl}/sltrsupps/by/q?PageSize=${data.pageSize}&PageIndex=${data.pageIndex}${searchInfoParam}`);
    }
}